//
//  PlantCollectionCell.m
//  iOS_NongLian
//
//  Created by n369 on 16/3/9.
//  Copyright © 2016年 NongLian. All rights reserved.
//

#import "PlantCollectionCell.h"

@implementation PlantCollectionCell

- (void)awakeFromNib {
    
}

- (void)setImage:(NSString *)image andText:(NSString *)text {
    if (!self.image) {
        self.image = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 48, 48)];
        [self.contentView addSubview:self.image];
    }
    if (!self.text) {
        self.text = [Factory createLabelWithTitle:@"" frame:CGRectMake(0, 56, 48, 12) textColor:RGBA(0, 0, 0, .8) fontSize:12];
        [self.contentView addSubview:self.text];
    }
    if (!self.deleteImage) {
        self.deleteImage = [[UIImageView alloc] initWithFrame:CGRectMake(38, 0, 10, 10)];
        //        image.backgroundColor = [UIImage imageNamed:@""];
        self.deleteImage.backgroundColor = [UIColor lightGrayColor];
        self.deleteImage.alpha = 0;
        [self.contentView addSubview:self.deleteImage];
    }
    self.image.image = [UIImage imageNamed:image];
    self.text.text = text;
}

@end
